/**
 * 
 */
package com.kaixin001.tk;

import java.util.HashMap;

import com.kaixin001.tk.api.ContextContainer;

/**
 * @author yuntxu
 *
 */
public class ContextContainerFactory {

	private ContextContainerFactory()
	{
		// do nothing
	}
	 
	private static HashMap<String, ContextContainer> allContexts = new HashMap<String, ContextContainer>();
	
	public static ContextContainer getContextContainer(String name)
	{
		ContextContainer cc = null;
		synchronized (allContexts) {
			cc = allContexts.get(name);			
			if(cc==null)
			{
				cc = new ContextContainerImpl();
			}
		}
		return  cc;
	}
}
